package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

/**
 * @author: jie.zhao
 * @create: 2021/06/02 13:53
 */
@Service
public class HelloServiceImpl implements HelloService {



    public String sayHello(String name) {
        return "你好"+name;
    }

    public String sayHello(URL url) {
        sleepTime();
        return "我是版本1方法1";
    }

    public String methodTwo(String name) {
        sleepTime();
        return "我是版本1方法2";
    }

    public String methodThree(String name) {
        sleepTime();
        return "我是版本1方法3";
    }

    private void sleepTime(){
        Random random = new Random();
        try {
            Thread.sleep(random.nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
